<template>
	<view class="container">
		<u-navbar
			title="设置" 
			:background="{backgroundColor: '#fff'}"
		></u-navbar>
		<view class="content">
			<block v-for="(item, index) in dataList">
				<view
					class="content_item flex justify-btw align-center"
					v-if="item.isShow"
					:key="index"
					@tap.stop="handleClick(item.value)"
				>
					<text>{{item.label}}</text>
					<image style="width: 18rpx; height: 33rpx;" src="../../static/images/right_arrow.png" mode=""></image>
				</view>
			</block>
		</view>
	</view>
</template>

<script setup>
import {getCurrentInstance, ref } from 'vue'
import { onLoad } from "@dcloudio/uni-app"
const {proxy} = getCurrentInstance()

const dataList = ref([
	{label: '提现账号设置', value:1, isShow: !proxy.utils.isHide()},
	{label: '关于我们', value:2, isShow: true},
	{label: '隐私政策', value:3, isShow: true},
])

function handleClick(value){
	if(value==1){
		if(proxy.utils.isLogin()){
			uni.navigateTo({ //提现账户
				url:`/pages/setting/withdrawAccount?pageType=${'all'}`
			})
		}
	}else if(value==2){
		uni.navigateTo({  //关于我们
			url:`/pages/agreement/agreement?pageTitle=关于我们&code=about_us`
		})
	}else if(value==3){
		uni.navigateTo({  //隐私政策
			url:`/pages/agreement/agreement?pageTitle=隐私政策&code=privacy_policy`
		})
	}
}
</script>

<style lang="scss" scoped>
	page{
		background-color: #f5f5f5;
	}
	.container {
		width: 100vw;
		height: 100vh;
		overflow-y: scroll;
		background-color: $uni-bg-color-grey;

		.content {
			&_item{
				width: 100vw;
				height: 112rpx;
				@include str(28rpx, bold, #333);
				line-height: 40rpx;
				background-color: #fff;
				padding: 20rpx;
				margin-bottom: 2rpx;
			}
		}
	}
</style>